<template>
  <div>
    <div ref="myChart" style="height: 600px;" />
  </div>
</template>

<script>
import * as echarts from 'echarts'
export default {
  mounted() {
    const myChart = echarts.init(this.$refs.myChart)

    var option = {
      title: {
        text: '价格数量分布'

      },
      legend: {},
      tooltip: {},
      dataset: {
        source: [
          ['product', '门店', '公寓', '别墅'],
          ['1000', 11.7, 65.5, 2.6],
          ['2000', 22.6, 43.4, 8.3],
          ['3000', 55.4, 55.2, 10],
          ['4000', 65.5, 33.9, 65.5],
          ['5000', 3.5, 8.9, 33.7]
        ]
      },
      xAxis: { type: 'category' },
      yAxis: {},
      // Declare several bar series, each will be mapped
      // to a column of dataset.source by default.
      series: [{ type: 'bar' }, { type: 'bar' }, { type: 'bar' }]
    }

    option && myChart.setOption(option)
  }
}
</script>

<style>

</style>
